home *** CD-ROM | disk | FTP | other *** search
/ The Best of MacTutor - S…e Code for Volumes 1 to 5 / The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin / Source Code / #48 (Sep 89) / Zoundz Source / Message.Pas < prev    next >
Pascal/Delphi Source File  |  1989-05-01  |  931b  |  30 lines

  1. unit Message;
  2.  
  3. interface
  4.  
  5.     procedure A_Message (s0, s1, s2, s3: str255; var theItem: integer);
  6.  
  7. implementation
  8.  
  9.     procedure A_Message;
  10.         var
  11.             itemHit: Integer;
  12.             AlertResHandle: AlertTHndl;
  13.             tempRect: Rect;
  14.  
  15.     begin                           {Start of alert handler}
  16.         ParamText(s0, s1, s2, s3);
  17.         AlertResHandle := AlertTHndl(GetResource('ALRT', 4));
  18.         HLock(Handle(AlertResHandle));
  19.         tempRect := AlertResHandle^^.boundsRect;
  20.         tempRect.Left := ((screenBits.Bounds.Right - screenBits.Bounds.Left) - (tempRect.Right - tempRect.Left)) div 2;{Center Horz}
  21.         tempRect.Bottom := tempRect.Top + (AlertResHandle^^.boundsRect.Bottom - AlertResHandle^^.boundsRect.Top);
  22.         tempRect.Right := tempRect.Left + (AlertResHandle^^.boundsRect.Right - AlertResHandle^^.boundsRect.Left);
  23.         AlertResHandle^^.boundsRect := tempRect;
  24.  
  25.         theItem := NoteAlert(4, nil);
  26.         HUnLock(Handle(AlertResHandle));
  27.  
  28.     end;                            {End of procedure}
  29.  
  30. end.                                {End of unit}